import libxml2

doc = libxml2.parseFile("habitaciones2.xml")
ctxt = doc.xpathNewContext()
res = ctxt.xpathEval("//puerta/@a")
#res = ctxt.xpathEval("//habitacion")

print 'Hay '+str(len(res))+' puertas que dan:'

for destino in res:
	print str(destino)

doc.freeDoc()
ctxt.xpathFreeContext()
